package main

import "fmt"
func main(){
	var t complex128
	t = 2.1 + 3.14i
	fmt.Println("t = ",t)

	// 自动推导类型
	t2 := 3.14 +2.2i

	fmt.Println("t2 = ",t2)
	fmt.Printf("type of t2 is: %T \n",t2)

	// 通过自建函数取复数实部和虚部
	fmt.Print("t2的实部=",real(t2),"\nt2的虚部是=",imag(t2))
}
